package com.fansl.allround.study.designpattern.singleton;

import lombok.Getter;
import lombok.Setter;

/**
 * @author fansl
 * @Description: 懒汉模式
 * @date 2019/10/11 11:13
 */
public class LazySingleton {
    @Getter
    @Setter
    private String name;
    private static class LazyHolder{
        private static final LazySingleton INSTANCE = new LazySingleton();
    }

    public static LazySingleton getInstance() {
        return LazyHolder.INSTANCE;
    }

    private LazySingleton() {
    }
}
